package eden.api.common.model;


import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class EdenResult<T> {

    private boolean success;

    private int code;

    private String msg;

    private T data;

    public static EdenResult<?>  ok(Object obj){
        return EdenResult.builder().success(true).code(200).data(obj).build();
    }


    public static EdenResult<?>  fail(Object obj){
        return EdenResult.builder().success(true).code(201).data(obj).build();
    }

    public static EdenResult<?>  failLogin(Object obj){
        return EdenResult.builder().success(true).code(401).data(obj).build();
    }





}
